<div class="container main" ng-controller="InquireListCtrl">

    <div class="row">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                 <div class="text-center"><strong>{[moduleTitle|uppercase]}</strong></div>
                <div class="row">
                    <div class="col-md-4">
                        <span class="btn-group">
                            <button data-toggle="dropdown" class="btn btn-default dropdown-toggle">
                            <strong>Actions</strong>&nbsp;&nbsp;<i class="caret"></i></button>
                            <ul class="dropdown-menu">
                                <li>
                                    <a ng-click="removeSelectedList(objects, query)" href="javascript:void(0);">Delete</a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a onclick="" href="javascript:void(0);">Import</a>
                                </li>
                                <li>
                                    <a onclick="" href="javascript:void(0);">Export</a>
                                </li>
                            </ul>

                        </span>
                        <span class="btn-group">
                            <button class="btn btn-primary pull-left">
                                <i class="glyphicon glyphicon-plus icon-white"></i> Add
                            </button>
                        </span>
                    </div>

                    <div class="col-md-8">
                        <form name="form_query" ng-submit="query()" class="form-inline pull-right">
                            <div class="form-group">
                                <label class="sr-only"></label>
                                <input type="text" class="form-control" ng-model="parameters.query" placeholder="Keywords" />
                            </div>
                            <div class="form-group">
                                <label class="sr-only"></label>
                                <select class="form-control" name="limit" ng-model="parameters.limit">
                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                    <option value="50">50</option>
                                    <option value="100">100</option>
                                    <option value="0">Unlimited</option>
                                </select>
                            </div>
                            <button type="submit" class="btn btn-info"> <i class="glyphicon glyphicon-search icon-white"></i> Search</button>
                        </form>
                    </div>
                </div>

            <table class="table table-striped table-bordered table-condensed table-hover" ng-show="objects.length > 0" ts-wrapper>
                <thead>
                    <tr>
                        <!--<th>
                            <select-all-checkbox checkboxes="objects" all-selected="AllSelectedItems"
                            all-clear="NoSelectedItems"></select-all-checkbox>
                        </th>-->
                        <th ts-criteria="email">Email</th>
                        <th ts-criteria="vector.vector_id">Vector Id</th>
                        <th ts-criteria="vector.vector_name">Vector Name</th>
                        <th ts-criteria="created_time">Created Time</th>
                        <th ts-criteria="price" class="width-1-1">Price ($)</th>
                        <th></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="obj in objects" ts-repeat="ts-repeat">
                        <!--<td class="text-center">
                            <input type="checkbox" ng-model="obj.isSelected" />
                        </td>-->
                        <td>
                            {[ obj.email ]}
                        </td>
                         <td>
                             <a ng-if="obj.vector.vector_id" target="_blank" href="{[VBDOMAIN]}/#!/vector/{[obj.vector.uuid]}" class="ng-binding">
                                 {[obj.vector.vector_id]}
                             </a>
                         </td>
                         <td>{[ obj.vector.vector_name || 'empty' ]}</td>
                        <td>{[ obj.created_time | fixDateTime ]}</td>
                        <td class="inquire-price">
                            <a ng-if="!obj.is_completed" href="javascript:void(0)" editable-text="obj.price" onbeforesave="inquire_update(obj.id, 'price', $data)">
                               {[ obj.price || 'empty' ]}
                            </a>
                            <span ng-if="obj.is_completed">{[ obj.price || 'empty' ]}</span>
                        </td>
                        <td><button ng-click="openInquireDetail(obj)" class="btn btn-primary btn-xs pull-left" type="button">Detail</button></td>
                         <td>
                            <button ng-disabled="obj.price=='0.00'||obj.is_completed" ng-click="sendMessage(obj)" class="btn btn-primary btn-xs pull-left" type="button">SendMessage</button>
                        </td>
                    </tr>
                </tbody>
            </table>
            </div>
        </div>
    </div>

    <div ng-include="'/static/js/views/components/pager.html'" style="display: inline;"></div>
</div>